package com.vhall.component.entity.exam.vo;

import com.vhall.component.framework.common.annotation.ParamName;
import lombok.Data;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.Pattern;
import javax.validation.constraints.Size;
import java.io.Serializable;

/**
 * @author song.dong
 * @date 2021-07-13 14:28
 */

@Data
public class ExamListReqVo implements Serializable {

    @ParamName("room_id")
    @Size(max = 15, message = "room_id参数值过长")
    private String roomId;

    @ParamName("exam_id")
    private Integer examId;

    @ParamName("account_id")
    private Integer accountId;

    @ParamName("keyword")
    private String keyword;

    @ParamName("from_room_id")
    private Integer fromRoomId;

    @ParamName("answer_account_id")
    private Integer answerAccountId;

    @ParamName("page")
    private Integer page = 1;

    @ParamName("pagesize")
    private Integer pageSize = 10;

    @ParamName("begin_time")
    @Pattern(regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))",
            message = "时间格式应为：yyyy-MM-dd")
    private String beginTime;

    @ParamName("end_time")
    @Pattern(regexp = "^((([0-9]{3}[1-9]|[0-9]{2}[1-9][0-9]{1}|[0-9]{1}[1-9][0-9]{2}|[1-9][0-9]{3})-(((0[13578]|1[02])-(0[1-9]|[12][0-9]|3[01]))|((0[469]|11)-(0[1-9]|[12][0-9]|30))|(02-(0[1-9]|[1][0-9]|2[0-8]))))|((([0-9]{2})(0[48]|[2468][048]|[13579][26])|((0[48]|[2468][048]|[3579][26])00))-02-29))",
            message = "时间格式应为：yyyy-MM-dd")
    private String endTime;

    @ParamName("publish")
    @Min(0)
    @Max(1)
    private Integer publish;

    @ParamName("is_finish")
    private Integer isFinish;

    @ParamName("is_grade")
    private Integer isGrade;

    @ParamName("is_push_grade")
    private Integer isPushGrade;

    @ParamName("status")
    @Min(1)
    @Max(5)
    private Integer status;
}
